package com.csun.cmny.provider.controller;

import com.csun.cmny.core.support.BaseController;
import com.csun.cmny.provider.dao.OmcSchedulMapper;
import com.csun.cmny.provider.dto.Group;
import com.csun.cmny.provider.dto.SchedulQueryDto;
import com.csun.cmny.provider.model.domain.OmcNursingUserBind;
import com.csun.cmny.provider.model.domain.OmcSchedul;
import com.csun.cmny.provider.model.domain.OmcShifts;
import com.csun.cmny.provider.model.dto.user.OmcUserQueryDto;
import com.csun.cmny.provider.model.vo.OmcUserVo;
import com.csun.cmny.provider.resolver.CmnyMessageSource;
import com.csun.cmny.provider.service.*;
import com.csun.cmny.provider.utils.DateUtil;
import com.csun.cmny.provider.utils.MenuTimeUtil;
import com.csun.cmny.provider.utils.NursinglogUtil;
import com.csun.cmny.provider.vo.IndexHomeVo;
import com.csun.cmny.provider.vo.NursingGroupVo;
import com.csun.cmny.provider.vo.OldManVo;
import com.csun.cmny.provider.vo.UserNameTimeVo;
import com.csun.cmny.util.PublicUtil;
import com.csun.cmny.util.wrapper.WrapMapper;
import com.csun.cmny.util.wrapper.Wrapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * 系统首页控制器
 */
@RestController
@RequestMapping(value = "/indexHome", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class OmcIndexHomeController extends BaseController {

    @Resource
    private CmnyMessageSource cmnyMessageSource;

    @Resource
    private OmcSchedulMapper omcSchedulMapper;

    @Resource
    private OmcFoodService omcFoodService;

    @Resource
    private OmcIndexHomeService omcIndexHomeService;

    @Resource
    private OmcGroupService omcGroupService;

    @Resource
    private UacRpcService uacRpcService;

    @Resource
    private OldmanService oldmanService;

    @Resource
    private OmcScheduleService omcSchedulService;

    @Resource
    private OmcNursingUserBindService omcNursingUserBindService;

    @Resource
    private OmcShiftsService omcShiftsService;


    /**
     * 首页数据查询
     */
    @RequestMapping(value = "/todaySchedul", method = RequestMethod.POST)
    public Wrapper todaySchedul(SchedulQueryDto schedulQueryDto) {
//        String msg_comment_query_success = cmnyMessageSource.getMessage("comment.query.success", null);
//        String msg_comment_query_param_error = cmnyMessageSource.getMessage("comment.query.param.error", null);
//        String msg_index_month_pattern_error = cmnyMessageSource.getMessage("index.month.pattern.error", null);
//        String msg_index_date_pattern_error = cmnyMessageSource.getMessage("index.date.pattern.error", null);

//        //校验
//        Map<String, String> errorMap = new HashMap<String, String>();
//        String monDate = schedulQueryDto.getMonDate();
//        String tueDate = schedulQueryDto.getTueDate();
//        String wedDate = schedulQueryDto.getWedDate();
//        String thuDate = schedulQueryDto.getThuDate();
//        String friDate = schedulQueryDto.getFriDate();
//        String satDate = schedulQueryDto.getSatDate();
//        String sunDate = schedulQueryDto.getSunDate();
//        String month = schedulQueryDto.getMonth();
//        //格式 yyyy-MM-dd 2018-04-16
//        String pattern = "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
//                + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
//                + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$";
//        //验证入参
//        if (StringUtils.isNotBlank(monDate) && !Pattern.matches(pattern, monDate)) {
//
//            errorMap.put("monDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(tueDate) && !Pattern.matches(pattern, tueDate)) {
//
//            errorMap.put("tueDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(wedDate) && !Pattern.matches(pattern, wedDate)) {
//
//            errorMap.put("wedDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(thuDate) && !Pattern.matches(pattern, thuDate)) {
//
//            errorMap.put("thuDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(friDate) && !Pattern.matches(pattern, friDate)) {
//
//            errorMap.put("friDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(satDate) && !Pattern.matches(pattern, satDate)) {
//
//            errorMap.put("satDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        if (StringUtils.isNotBlank(sunDate) && !Pattern.matches(pattern, sunDate)) {
//
//            errorMap.put("sunDate", msg_index_date_pattern_error);
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        }
//        String pattern1 = "^(0+[1-9]|1[0-2])$";
//        if (StringUtils.isBlank(month)) {
//
//            return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//        } else {
//            if (!Pattern.matches(pattern1, month)) {
//
//                errorMap.put("month", msg_index_month_pattern_error);
//
//                return WrapMapper.wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, msg_comment_query_param_error, errorMap);
//            }
//        }
//        OmcSchedul omcSchedul = new OmcSchedul();
//        BeanUtils.copyProperties(schedulQueryDto, omcSchedul);
        //获取当日日期
        String thisDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());

        IndexHomeVo indexHomeVo = new IndexHomeVo();
        Long groupId = getLoginAuthDto().getGroupId();
        //在住老人、试住老人
        List<Integer> oldManNumberList = omcIndexHomeService.oldManNumberList(groupId);
        indexHomeVo.setCheckInOldMan(oldManNumberList.get(0));//在住老人
        indexHomeVo.setTryCheckIn(oldManNumberList.get(1));//试住老人
        //今日预约（咨询）、今日试住、今日外出（请假）
        List<Integer> todayList = omcIndexHomeService.todayList(groupId,thisDate);
        indexHomeVo.setOrder(todayList.get(0));//今日预约（咨询）
        indexHomeVo.setTodayTryCheckIn(todayList.get(1));    //今日试住
        indexHomeVo.setOut(todayList.get(2));//今日外出（请假）
        //机构员工人数、护工人数
        OmcUserQueryDto omcUserQueryDto = new OmcUserQueryDto();
        omcUserQueryDto.setGroupId(groupId);
        List<OmcUserVo> list1 = uacRpcService.queryOmcUserListByQueryDto(omcUserQueryDto);//机构员工
        int nusringCount = 0;//护工人数
        for (OmcUserVo omcUserVo : list1) {
            if (null != omcUserVo.getRoleName() && "护工".equals(omcUserVo.getRoleName())) {
                nusringCount += 1;
            }
        }
        indexHomeVo.setStaffNumber(list1.size());//员工人数
        indexHomeVo.setNursingNumber(nusringCount);//护工人数
        //取得该机构的所有护工组
        Group group = new Group();
        group.setGroupId(groupId);
        List<NursingGroupVo> groupList = omcGroupService.selectListByName(group);

        /*
         * 修复#3556【首页】数据统计错误
         * */

        //获取本周周数
        String thisWeek = MenuTimeUtil.getDays(thisDate).get(1) + MenuTimeUtil.getDays(thisDate).get(0);

        //放入周数、机构id的查询条件
        OmcSchedul schedulQuery = new OmcSchedul();
        schedulQuery.setGroupId(getLoginAuthDto().getGroupId());
        schedulQuery.setWeek(Integer.parseInt(thisWeek));
        schedulQuery.setStatus(2);//审批通过

        /**
         * @author  chisj
         * @date    2021-08-17 13:48
         * @desc    临时修改一个班长在多个班组的问题
         */
        //如果查询角色是护工、班长，加入护工组查询条件
        OmcNursingUserBind nursingUserBind = new OmcNursingUserBind();
        nursingUserBind.setUserId(getLoginAuthDto().getUserId());
        List<OmcNursingUserBind> nursingUserBindList = omcNursingUserBindService.select(nursingUserBind);
        List<OmcSchedul> omcSchedulList = Lists.newArrayList();
        if (PublicUtil.isNotEmpty(nursingUserBindList)) {
            for (OmcNursingUserBind onub : nursingUserBindList) {
                schedulQuery.setNursingGroupId(onub.getNursingGroupId().intValue());
                //查询排班计划
                List<OmcSchedul> schedulList = omcSchedulService.select(schedulQuery);
                omcSchedulList.addAll(schedulList);
            }
        }

        //创建交班项目查询对象
        OmcShifts shiftsQuery;

        if (CollectionUtils.isEmpty(omcSchedulList)) {
            indexHomeVo.setUserNameList(new ArrayList<>());
        } else {
            List<UserNameTimeVo> userNameList = new ArrayList<UserNameTimeVo>();
            for (OmcSchedul schedul : omcSchedulList) {
                if (schedul.getMonDate() != null && schedul.getMonDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getMonRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周二排班
                if (schedul.getTueDate() != null && schedul.getTueDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getTueRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周三排班
                if (schedul.getWedDate() != null && schedul.getWedDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getWedRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周四排班
                if (schedul.getThuDate() != null && schedul.getThuDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getThuRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周五排班
                if (schedul.getFriDate() != null && schedul.getFriDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getFriRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周六排班
                if (schedul.getSatDate() != null && schedul.getSatDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getSatRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
                //周日排班
                if (schedul.getSunDate() != null && schedul.getSunDate().equals(thisDate)) {
                    UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                    //查询护工名称
                    List<String> userName = NursinglogUtil.getFoodNameList(schedul.getSunRealName());
                    userNameTimeVo.setUserName(userName);
                    userNameTimeVo.setDate(thisDate);
                    //查询交班项信息
                    shiftsQuery = omcShiftsService.selectByKey(schedul.getShiftsId());
                    userNameTimeVo.setTime(shiftsQuery.getTime());
                    userNameTimeVo.setName(shiftsQuery.getName());
                    if (null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))) {
                        userNameList.add(userNameTimeVo);
                    }
                }
            }
            indexHomeVo.setUserNameList(userNameList);
        }

       /* //将该机构的第一个护工组id赋给schedul
       if(CollectionUtils.isEmpty(groupList)){
            indexHomeVo.setUserNameList(new ArrayList<>());
       }else{
           List<UserNameTimeVo> userNameList = new ArrayList<UserNameTimeVo>();
           for (NursingGroupVo nursingGroupVo:groupList) {
               omcSchedul.setNursingGroupId(nursingGroupVo.getId().intValue());
               omcSchedul.setStatus(2);//审批通过
               //查询到该周的所有排班信息
               //List<OmcSchedul> schedulList = omcSchedulService.queryScheduleList(omcSchedul,getLoginAuthDto());
               //查询该周登录人班组所有的排班信息
               List<OmcSchedul> schedulList = omcSchedulMapper.select(omcSchedul);
               //根据班次集合
               for (OmcSchedul schedul:schedulList) {
                   //周一排班
                   if(omcSchedul.getMonDate() != null && omcSchedul.getMonDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getMonRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getMonDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周二排班
                   if(omcSchedul.getTueDate() != null && omcSchedul.getTueDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getThuRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getTueDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周三排班
                   if(omcSchedul.getWedDate() != null && omcSchedul.getWedDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getWedRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getWedDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周四排班
                   if(omcSchedul.getThuDate() != null && omcSchedul.getThuDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getThuRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getThuDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周五排班
                   if(omcSchedul.getFriDate() != null && omcSchedul.getFriDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getFriRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getFriDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周六排班
                   if(omcSchedul.getSatDate() != null && omcSchedul.getSatDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getSatRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getSatDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
                   //周日排班
                   if(omcSchedul.getSunDate() != null && omcSchedul.getSunDate().length() > 0){
                       UserNameTimeVo userNameTimeVo = new UserNameTimeVo();
                       List<String> userName = NursinglogUtil.getFoodNameList(schedul.getSunRealName());
                       userNameTimeVo.setUserName(userName);
                       userNameTimeVo.setDate(schedul.getSunDate());
                       if(null != schedul.getOmcShifts()){
                           userNameTimeVo.setTime(schedul.getOmcShifts().getTime());
                           userNameTimeVo.setName(schedul.getOmcShifts().getName());
                       }
                       if(null != userNameTimeVo.getUserName() && !"".equals(userNameTimeVo.getUserName().get(0))){
                           userNameList.add(userNameTimeVo);
                       }
                   }
               }
           }
           indexHomeVo.setUserNameList(userNameList);
       }*/

            //院内床位、空余床位、已预订床位、院内房间
            List<Integer> bedNumberList = omcIndexHomeService.bedNumberList(groupId);
            indexHomeVo.setBedTotal(bedNumberList.get(0));//院内床位
            indexHomeVo.setEmptyBed(bedNumberList.get(1));//空余床位
            indexHomeVo.setReservationBed(bedNumberList.get(2));//已预订床位
            indexHomeVo.setRoomTotal(bedNumberList.get(3));//院内房间
            int checkInOldMan = oldManNumberList.get(0).intValue();//在住老人
            int bedTotal = bedNumberList.get(0).intValue();        //院内床位
            // 创建一个数值格式化对象
            NumberFormat numberFormat = NumberFormat.getPercentInstance();
            // 设置精确到小数点后2位
            numberFormat.setMinimumFractionDigits(2);
            if (bedTotal == 0) {
                indexHomeVo.setCheckInRate("0.00%");//入住率
            } else {
                String result = numberFormat.format((float) checkInOldMan / (float) bedTotal);
                indexHomeVo.setCheckInRate(result);//入住率
            }

            //获取当前周的周一
            String mon = DateUtil.getMonday().substring(5);//截取月份和日 09-22
            String sun = DateUtil.getSunday().substring(5);//截取月份和日 09-22
            Integer isCrossYear = null;// 判断是否跨年，0-是，1-否
            if (mon.compareTo(sun)>0){
                isCrossYear = 0;
            }else if (mon.compareTo(sun)<0){
                isCrossYear = 1;
            }
            Map<String, Object> queryParam = new HashMap<String, Object>();
            queryParam.put("mon", mon);
            queryParam.put("sun", sun);
            queryParam.put("groupId", groupId);
            queryParam.put("isCrossYear",isCrossYear);
            //查询一周老人生日
            List<OldManVo> oldmanlist = oldmanService.selectByWeek(queryParam);
            for (int i = 0; i < oldmanlist.size(); i++) {
                String birthday = oldmanlist.get(i).getBirthday();
                oldmanlist.get(i).setBirthday(birthday.substring(5));
            }
            indexHomeVo.setOldmanlist(oldmanlist);//一周老人生日
            return WrapMapper.wrap(Wrapper.SUCCESS_CODE, cmnyMessageSource.getMessage("comment.query.success", null), indexHomeVo);
        }
}
